package freedom;

import java.util.Random;
import java.util.Scanner;

/**
 * 本类用于基础知识复习
 */
public class TestBasic {
    public static void main(String[]args){
        exchanged();

    }
    public static void exchanged(){
        //随机给的数
        try {
            int num1 = new Random().nextInt(100);
            int num2= new Random().nextInt(100);
            System.out.println("交换前:"+num1);
            System.out.println("交换前:"+num2);
            int temp=num1;
            num1=num2;
            num2=temp;
            System.out.println("交换后:"+num1);
            System.out.println("交换后:"+num2);
        }catch(Exception e){
            System.out.println("您输入的不对！请重新输入！");
        }

    }
}
